#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include "Scene/mscene.h"
#include "Scene/mprocess.h"
#include <QLabel>
#include<QButtonGroup>
#include <QToolBar>
#include "Scene/mlistwidgetdrag.h"
#include <QDir>
#include<QMap>
#include<Util/datautil.h>
#include<UI/inputdialog.h>
#include<Util/cstate.h>
#include<UI/packagerui.h>
#include<Util/mdlinfo.h>
#include<UI/patchmethod.h>
#include<Util/dccinfo.h>
#include<UI/FileOrFold.h>
#include<Util/PathUtil.h>
#include<Util/PrePackage.h>
#include<UI/SchemaSettings.h>
#include<UI/PreView.h>
#include "Util/HandleListWidget.h"
#include<Util/ExePackHelper.h>
#include<Util/ProjectHandle.h>

QT_BEGIN_NAMESPACE
class QAction;
class QToolBox;
class QSpinBox;
class QComboBox;
class QFontComboBox;
class QButtonGroup;
class QLineEdit;
class QGraphicsTextItem;
class QFont;
class QToolButton;
class QAbstractButton;
class QGraphicsView;
class QTreeWidget;
QT_END_NAMESPACE
namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT
public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();


signals:
    void sendInfoStr(QString);
private:
    Ui::MainWindow *ui;
    QLabel* first_statusLabel; //声明d标签对象，用于显示状态信息
    QMenu *itemMenu;
    QGraphicsView *view;
    QWidget *newView;
    mListWidgetDrag *mListWidget;
    QButtonGroup *buttonGroup;
    QButtonGroup *pointerTypeGroup;
    QToolBar mToolBar;
    QToolBox *mToolBox;
    QList<QString> *StatesNameList;
    QString DirPath;  //工程所在路径
    QMap<QListWidgetItem *,MdlInfo *> *MdlInfoMap; //MdlInfoMap
    QString currentMdlPath; //当前选中的mdl
    int currentMdlIndex;
    QString ProjectPath; //OMS工程路径
    QList<QString> *inputDataList;
    InputDialog *inputDialog;
    QString ModelNameShowing;
    PackagerUI *pUI;
    QList<CState *> * currentStateList;
    PatchMethod *patchMethod;
    QMap<int,DCCInfo *> *DCCInfoMap =NULL;
    int CurrentType;
    SchemaSettings *mSchemaSettings;
    PreView *MdlPreviewWidget;
    QListWidgetItem *CurrentItem;
    QString mInitialFolder="";
    PrePackage *mPrePackage;



    void init_statusBar(); //初始化状态栏
    void init_leftList(); //初始化左边列表
    void initListWidget();
    void initTable();
    void showScene(QListWidgetItem *item);



    void initDirPath();
    bool getSortNamesList();
    bool initOmsWraperPath();
    void openLyoFile(QString ); //读取lyo文件
    void omsPackaged();
    void otherPackaged();
    void ExePackaged();
    void LoadMdl(QString mdlPath);

private slots:

    void addMdl_Clicked();

    void openOMS_clicked();

    void ItemsList_itemClicked(QListWidgetItem *item);

    void MdlListItemClicked(QModelIndex);

    void ChooseModel_currentIndexChanged(int index);

    void ChooseLibs_clicked();

    void LibItemsRemove_clicked();

    void LockLibsTable_clicked();

    void AddHardwareConItem_clicked();

    void HardConRemove_clicked();

    void AddSoftEnvirItem_clicked();

    void SoftEnvirRemove_clicked();

    void AddTestDataItem_clicked();

    void TestDataRemove_clicked();

    void AddSuportResItem_clicked();

    void SuportResRemove_clicked();

    void GeneratePackage_clicked();

    void patchmethod_clicked();  //配置数据方法

    void ChooseLicense_currentTextChanged(const QString &arg1);

    void SettingsSchema_clicked();

    void getDCCInfo(QMap<int,DCCInfo *> *dCCInfoMap);

    void ReceiveData(QList<QString> *inputData);

    void deleteItem();

    void clearItem();

    void showStateinfo(QString infoStr);

    void on_actionOpen_Mdl_triggered();

    void on_actionConfigure_Convertion_Tools_triggered();

    void on_actionBuild_Package_triggered();

    void on_actionMdl_triggered();

    void on_actionMethod_triggered();

    void showZipDialog();

    void on_actionLoad_Project_triggered();

    void on_actionSave_Project_triggered();

    void MdlListWidget_CurrentIndex_changed(int);

protected:
    void keyPressEvent(QKeyEvent *e);
    void closeEvent(QCloseEvent *event);



};

#endif // MAINWINDOW_H
